/**
 * @param {number[]} nums
 * @return {number}
 */
var findValueOfPartition = function (nums) {
  nums.sort((a, b) => a - b)
  let min = Number.MAX_VALUE
  console.log('nums: ', nums)
  // let left = 0
  // let right = 0
  for (let i = 1; i < nums.length; i++) {
    let abs = Math.abs(nums[i] - nums[i - 1])
    console.log('abs: ', abs)
    console.log('min: ', min)
    if (min > abs) {
      min = abs
      // left = nums[i]
      // right = nums[i - 1]
    }
  }
  return min
}

let nums = [59, 51, 1, 98, 73]
nums = [3, 72, 8, 90]
console.log(findValueOfPartition(nums))
